package com.hr.until;

import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.Date;

/*
    Created with IntelliJ IDEA.
    @author: wang sir
    Date: 2021/7/24
    Time: 9:49
    To change this template use File | Settings | File Templates.
    Description: 
 */
@Component
 public class DateConverter implements Converter<String, Date> {

    @Override
    public Date convert(String s) {
        try {
            return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(s);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

}